LoadMovieIntoRam
TheLoadMovieIntoRam
function loads a movie's data into memory. If the movie does not fit, the function returns an error.
pascal OSErr LoadMovieIntoRam (Movie theMovie, TimeValue time, TimeValue duration, long flags);
theMovie
- Specifies the movie for this operation. Your application obtains this movie identifier from such functions as
NewMovie
,NewMovieFromFile
, andNewMovieFromHandle
(described on page 2-80, page 2-76, and page 2-78, respectively).time
- Allows you to specify a portion of the movie to load. The
time
parameter contains the starting time of the movie segment to load. Theduration
parameter specifies the length of the segment to load.duration
- Allows you to specify a portion of the movie to load. The
time
parameter contains the starting time of the movie segment to load. Theduration
parameter specifies the length of the segment to load. You can use theGetMovieDuration
function (described on page 2-170) to determine the length of the entire movie. Note that the Movie Toolbox may load more data than you specify due to the way the data is loaded.flags
- Gives you explicit control over what is loaded into memory and how long to keep it around. The following constants are provided. You can set these flags in any combination that makes sense for you.
keepInRam
Renders all data loaded with this flag set as nonpurgeable. Nonpurgeable data is not released from memory until you request it explicitly. This practice can fill up your heap very quickly. Exercise caution.unkeepInRam
Renders all indicated data purgeable. The data is not necessarily released from memory immediately, however. Information about whether a chunk can be purged is maintained internally by a single bit. This means there is no counter. Therefore, if you care very much about the data, you have to work very hard and use the edit list meticulously.flushFromRam
Purges all indicated data from memory, unless it is currently in use by a media handler (for example, if it is still drawing frames from the requested times). This flag makes the memory available for purging, and then performs the purge. You may want to use this option if you are particularly low on memory.loadForwardTrackEdits
- In some cases, an edited movie plays back much more smoothly if the data around edits is already in RAM. By setting either this flag or the
lookBackwardTrackEdits
flag, you can load only the data around edits. The Movie Toolbox walks through the edits and decides the right amount of data to load for you. If you are going to play the movie forward, set only theloadForwardTrackEdits
flag. If you are going to play in both directions, or you don't know which direction, set both flags.loadBackwardTrackEdits
In some cases, an edited movie plays back much more smoothly if the data around edits is already in RAM. By setting either this flag orlookForwardTrackEdits
, you can load only the data around edits. The Movie Toolbox walks through the edits and decides the right amount of data to load for you. If you are going to play the movie only backward, set theloadBackwardTrackEdits
flag. If you are going to play in both directions, or you don't know which direction, set both flags.DESCRIPTION
IfLoadMovieIntoRam
fails because it was out of memory, no data is purged.ERROR CODES
File Manager errors
invalidMovie -2010 This movie is corrupted or invalid invalidDuration -2014 This duration value is invalid invalidTime -2015 This time value is invalid progressProcAborted -2019 Your progress function returned an error
Memory Manager errors